package com.woniuxy.cloud.carl.marketing.client;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.cloud.carl.marketing.client.param.AddDeductionParam;
import com.woniuxy.cloud.carl.marketing.client.param.AddFullDiscount;
import com.woniuxy.cloud.carl.marketing.client.param.GetCouponParam;
import com.woniuxy.cloud.carl.marketing.infra.model.Deduction;
import com.woniuxy.cloud.carl.marketing.infra.model.FullDiscountCoupon;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 满减券 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2023-07-19
 */
@FeignClient(contextId = "fullDiscountCouponClient",name = "marketing")
public interface FullDiscountCouponClient {
    @PostMapping("/addFullDiscountCoupon")
    Result addFullDiscountCoupon(@RequestBody AddFullDiscount param);

    @GetMapping("/getFullDiscountCoupon")
    Result<Page<FullDiscountCoupon>> getFullDiscountCoupon(@SpringQueryMap GetCouponParam param);

    @GetMapping("/useFullDiscount")
    Result<FullDiscountCoupon> useFullDiscount(
            @RequestParam("price")BigDecimal price,@RequestParam("userId")Long userId,@RequestParam("couponId")Long couponId);


}

